﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AcctrueWMS.Foundation.Util;
using System.Drawing;


namespace AcctrueWMS.Web
{
    public partial class validateCode : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Clear();
            //获取验证码配置
            bool configValidate =Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["loginValidate"].ToString());
            if (configValidate)
            {
                string checkCode = AuthHelper.CreateRandomCode(4);
                Response.BinaryWrite(AuthHelper.CreateImage(checkCode));
                Session["vcode"] = AuthHelper.Encrpt(checkCode.Trim().Replace(" ", ""));//添加session
            }
            Response.End();
        }
    }
}